/*
*  CETimerWrapper.h
*  
*
*  Created by Alexander Trutchenko on 11/02/12.
*  Copyright 2012 Free Team. All rights reserved.
*
*/

#ifndef __LL_TimerWrapper_h__
#define __LL_TimerWrapper_h__


#include "cocos2d.h"



namespace cocosext {

////////////////////////////////////////////////////////
//
/** CETimerWrapper
*  
*/
////////////////////////////////////////////////////////

template <typename T>
class CETimerWrapper : public cocos2d::CCObject
{
typedef void (T::*T_method)(cocos2d::ccTime dt); 

	T* _target;
	T_method _method;

private:
	explicit CETimerWrapper();

public:
	CETimerWrapper(T* target, T_method method): _target(target), _method(method) {;} 
	virtual ~CETimerWrapper() 
	{
	}

public:
	virtual void update(cocos2d::ccTime dt) 
	{
		(_target->*_method)(dt);
	};
	virtual void tick(cocos2d::ccTime dt)
	{
		(_target->*_method)(dt);
	};
};

} // namespace cocosext

#endif //__LL_TimerWrapper_h__
